package com.wuliu.system.service.impl;

import java.util.List;
import com.wuliu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.wuliu.system.mapper.TspOrderDetailMapper;
import com.wuliu.system.domain.TspOrderDetail;
import com.wuliu.system.service.ITspOrderDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 托寄物明细Service业务层处理
 * 
 * @author realue
 * @date 2023-10-24
 */
@Service
public class TspOrderDetailServiceImpl extends ServiceImpl<TspOrderDetailMapper, TspOrderDetail> implements ITspOrderDetailService {
    @Resource
    private TspOrderDetailMapper tspOrderDetailMapper;

    /**
     * 查询托寄物明细
     * 
     * @param id 托寄物明细主键
     * @return 托寄物明细
     */
    @Override
    public TspOrderDetail selectTspOrderDetailById(String id) {
        return tspOrderDetailMapper.selectTspOrderDetailById(id);
    }

    /**
     * 查询托寄物明细列表
     * 
     * @param tspOrderDetail 托寄物明细
     * @return 托寄物明细
     */
    @Override
    public List<TspOrderDetail> selectTspOrderDetailList(TspOrderDetail tspOrderDetail) {
        return tspOrderDetailMapper.selectTspOrderDetailList(tspOrderDetail);
    }

    /**
     * 新增托寄物明细
     * 
     * @param tspOrderDetail 托寄物明细
     * @return 结果
     */
    @Override
    public int insertTspOrderDetail(TspOrderDetail tspOrderDetail) {
        tspOrderDetail.setCreateTime(DateUtils.getNowDate());
        return tspOrderDetailMapper.insertTspOrderDetail(tspOrderDetail);
    }

    /**
     * 修改托寄物明细
     * 
     * @param tspOrderDetail 托寄物明细
     * @return 结果
     */
    @Override
    public int updateTspOrderDetail(TspOrderDetail tspOrderDetail) {
        tspOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return tspOrderDetailMapper.updateTspOrderDetail(tspOrderDetail);
    }

    /**
     * 批量删除托寄物明细
     * 
     * @param ids 需要删除的托寄物明细主键
     * @return 结果
     */
    @Override
    public int deleteTspOrderDetailByIds(String[] ids) {
        return tspOrderDetailMapper.deleteTspOrderDetailByIds(ids);
    }

    /**
     * 删除托寄物明细信息
     * 
     * @param id 托寄物明细主键
     * @return 结果
     */
    @Override
    public int deleteTspOrderDetailById(String id) {
        return tspOrderDetailMapper.deleteTspOrderDetailById(id);
    }
}
